package com.example.graphic.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 图片基础信息实体
 */
@Data
@TableName("images")
public class Image implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long userId;

    private String filePath;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime uploadTime;

    private Long visitNum;

    private String fileName;

    private String fileCopywriting;

    // 关联数据（非数据库字段）
    @TableField(exist = false)
    private List<Tag> tags;

    @TableField(exist = false)
    private List<Copywriting> copywritings;
} 